package com.syh.jn.scm.service.api.upstream.sale.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
public interface UpSaleOrderEnums {

    @Getter
    @AllArgsConstructor
    public enum State {
        STAYCONFIRM(Short.valueOf("0"),"待确认"),
        CONFIRM(Short.valueOf("1"),"已确认"),
        HANG(Short.valueOf("2"),"已挂起"),
        STATEMENT(Short.valueOf("3"),"已生成对账单"),
        CANCEL(Short.valueOf("-1"),"已取消订单");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static State valueOf(Short status) {
            switch (status) {
                case 0:
                    return STAYCONFIRM;
                case 1:
                    return CONFIRM;
                case 2:
                    return HANG;
                case 3:
                    return STATEMENT;
                case -1:
                    return CANCEL;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum OrderType {
        ORDINARY_PURCHASE(Short.valueOf("0"),"普通采购"),
        PURCHASE_SALE(Short.valueOf("1"),"直采直销");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static OrderType valueOf(Short status) {
            switch (status) {
                case 0:
                    return ORDINARY_PURCHASE;
                case 1:
                    return PURCHASE_SALE;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum GeneratedState {
        LOGISTICS_UN_GENERATE(Short.valueOf("0"),"未生成物流"),
        LOGISTICS_PART_GENERATE(Short.valueOf("1"),"部分生成物流"),
        LOGISTICS_WHOLE_GENERATE(Short.valueOf("2"),"全部生成物流");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static GeneratedState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_GENERATE;
                case 1:
                    return LOGISTICS_PART_GENERATE;
                case 2:
                    return LOGISTICS_WHOLE_GENERATE;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum DeliveryState {
        LOGISTICS_UN_DELIVERY(Short.valueOf("0"),"未发货"),
        LOGISTICS_PART_DELIVEED(Short.valueOf("1"),"部分发货"),
        LOGISTICS_WHOLE_DELIVEED(Short.valueOf("2"),"全部发货");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static DeliveryState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_DELIVERY;
                case 1:
                    return LOGISTICS_PART_DELIVEED;
                case 2:
                    return LOGISTICS_WHOLE_DELIVEED;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum CollectState {
        LOGISTICS_UN_COLLECT(Short.valueOf("0"),"未签收"),
        LOGISTICS_PART_COLLECT(Short.valueOf("1"),"部分签收"),
        LOGISTICS_WHOLE_COLLECT(Short.valueOf("2"),"全部签收");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static CollectState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_COLLECT;
                case 1:
                    return LOGISTICS_PART_COLLECT;
                case 2:
                    return LOGISTICS_WHOLE_COLLECT;
            }
            return null;
        }
    }
}
